feat(theme): add theme toggle (light/dark/system) with provider, hook… - #284
Merged
Conversation
|
@Samaro1 is attempting to deploy a commit to the Jaja's projects Team on Vercel. A member of the Team first needs to authorize it. |
devJaja
self-requested a review
August 22, 2026 03:58
Contributor
|
Nice Implementation @Samaro1 Why: TypeScript compile error in TopNav.tsx (theme-cycle logic returns a plain string, not the ThemeMode type setMode expects) plus an unused import in the test file. Tests still show green because vitest skips type-checking — but the actual build is broken. Bonus issue: no flash-prevention on load, so light-theme users will see a flicker of dark theme on every refresh. Not mergeable as-is; needs the type fix before anything else. |
Contributor
|
@Samaro1 |
Samaro1
force-pushed
the
feat/theme-toggle
branch
from
August 24, 2026 22:53
5f2d45e to
94cc441
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a theme system with three modes (light, dark, system) and a toggle in the top navigation. Theme choice persists to localStorage and system preference changes update the UI when in System mode. Smooth 300ms transitions and CSS variable overrides for light theme included.
Files changed
Added: ThemeContext.tsx — provider with localStorage + matchMedia listener
Added: useTheme.ts — consumer hook
Added: TopNav.test.tsx — unit test for toggle behavior
Updated: TopNav.tsx — theme toggle button (sun/moon/monitor icons), accessible role="switch" and ARIA attributes
Updated: global.css — .theme-light variable overrides and 300ms transitions
Updated: App.tsx — wrapped app in ThemeProvider
Testing
Ran frontend tests: all passed (117 tests).


Dev server running at: http://localhost:3000/
Closes #223